package com.lgy.config;

public class DatabaseContextHolder {
	//枚举
	private static final ThreadLocal<DataSourceKey> contextHolder = new ThreadLocal<DataSourceKey>();

	public static String getCustomerType() {
		if(null == contextHolder.get()) {
			return null;
		}
		return contextHolder.get().getDataSource();
	}

	public static void clearCustomerType() {
		contextHolder.remove();
	}
	
	public static void setCustomerType(DataSourceKey DataSourceKey) {
		contextHolder.set(DataSourceKey);
	}
}
